﻿@using BootstrapBlazor.Shared.Samples;
@inject IStringLocalizer<Foo> LocalizerFoo
@inject IStringLocalizer<LabelsNormal> Localizer

<div>
    <p><b>@Localizer["LabelsNormalDescription"]</b></p>
    <ul class="ul-demo mb-3">
        <li>@((MarkupString)Localizer["LabelsNormalTips1"].Value)</li>
        <li>@((MarkupString)Localizer["LabelsNormalTips2"].Value)</li>
        <li>@((MarkupString)Localizer["LabelsNormalTips3"].Value)</li>
        <li>@((MarkupString)Localizer["LabelsNormalTips4"].Value)</li>
    </ul>

    <GroupBox Title="@Localizer["LabelsNormalGroupBox1Title"]" style="margin-top: 1.5rem;">
        <div>@Localizer["LabelsNormalGroupBox1Tips1"]</div>
        <div>@((MarkupString)Localizer["LabelsNormalGroupBox1Tips2"].Value)</div>
        <div>@((MarkupString)Localizer["LabelsNormalGroupBox1Tips3"].Value)</div>
        <div>@((MarkupString)Localizer["LabelsNormalGroupBox1Tips4"].Value)</div>
        <div class="row g-3 mt-3">
            <div class="col-sm-12 col-md-3">
                <BootstrapInput TValue="string" />
            </div>
            <div class="col-sm-12 col-md-3">
                <BootstrapInput TValue="string" ShowLabel="true" DisplayText="" />
            </div>
            <div class="col-sm-12 col-md-3">
                <BootstrapInput TValue="string" ShowLabel="true" DisplayText="@LocalizerFoo[nameof(Foo.Name)]" />
            </div>
            <div class="col-sm-12 col-md-3">
                <BootstrapInput TValue="string" ShowLabel="true" DisplayText="@null" />
            </div>
        </div>
    </GroupBox>

    <p class="mt-3"><b>@Localizer["LabelsNormalDescription2"]</b></p>
    <GroupBox Title="@Localizer["LabelsNormalGroupBox2Title"]" class="mt-3">
        <div>@((MarkupString)Localizer["LabelsNormalGroupBox2Tips1"].Value)</div>
        <div>@((MarkupString)Localizer["LabelsNormalGroupBox2Tips2"].Value)</div>
        <div>@((MarkupString)Localizer["LabelsNormalGroupBox2Tips3"].Value)</div>
        <div>@((MarkupString)Localizer["LabelsNormalGroupBox2Tips4"].Value)</div>
        <div class="row g-3 mt-3">
            <div class="col-sm-12 col-md-3">
                <BootstrapInput @bind-Value="Dummy.Name" />
            </div>
            <div class="col-sm-12 col-md-3">
                <BootstrapInput @bind-Value="Dummy.Name" ShowLabel="true" DisplayText="@LocalizerFoo[nameof(Foo.Address)]" />
            </div>
            <div class="col-sm-12 col-md-3">
                <BootstrapInput @bind-Value="Dummy.Name" ShowLabel="true" DisplayText="" />
            </div>
            <div class="col-sm-12 col-md-3">
                <BootstrapInput @bind-Value="Dummy.Name" ShowLabel="true" DisplayText="@null" />
            </div>
        </div>
    </GroupBox>
</div>

@code {
    [NotNull]
    private Foo? Dummy { get; set; }

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        Dummy = Foo.Generate(LocalizerFoo);
    }
}
